using System;
using System.Collections.Generic;
using System.Text;

namespace Graphs
{
	class CEdge
	{
		private Guid guid;
		private CNode startNode;
		public CNode StartNode
		{
			get { return startNode; }
		}
		
		private CNode endNode;
		public CNode EndNode
		{
			get { return endNode; }
		}


		private bool hiLite;

		public bool HiLite
		{
			get { return hiLite; }
			set { hiLite = value; }
		}



		
		private double length=double.NaN;
		public double Length
		{
			get {

				if (length == double.NaN)
				{
					length = Math.Sqrt(Math.Pow(startNode.Location.X - endNode.Location.X, 2) + Math.Pow(startNode.Location.Y - endNode.Location.Y, 2));
				}
				return length; 
			}
		}

	


		public CEdge()
		{
			startNode = null;
			endNode = null;
		}
		
		public CEdge(CNode sNode, CNode eNode)
		{
			this.guid = Guid.NewGuid();
			startNode = sNode;
			endNode = eNode;
		}



	}
}
